<?php
namespace app\index\controller;
use app\index\model\Nav;
use app\index\model\ProCate;
use app\index\model\Banner;
use app\index\model\NewsCate;
use think\Controller;
use app\index\model\Job;
class Index extends Controller
{
    public function index()
    {
        $model = new Nav();
        $ProCateModel = new ProCate();
        $Banner = new Banner();
        $data = $model->select();
        $procate=$ProCateModel->select();
        $banner=$Banner->order('sort asc')->select();
        $url=request()->module().'/'.request()->action();
        $this->assign('data',$data);
        $this->assign('url',$url);
        $this->assign('banner',$banner);
        $this->assign('procate',$procate);
        return  $this->fetch();
    }
    public function pro(){
        $model = new Nav();
        $ProCateModel = new ProCate();
        $procate=$ProCateModel->select();
        $data = $model->select();
        $url=request()->module().'/'.request()->action();
        $this->assign('data',$data);
        $this->assign('url',$url);
        $this->assign('procate',$procate);
        return $this->fetch();
    }
    public function pro_more(){
        $model = new Nav();
        $data = $model->select();
        $url=request()->module().'/'.request()->action();
        $this->assign('data',$data);
        $this->assign('url',$url);
        return $this->fetch();
    }
    public function job(){
        $model = new Nav();
        $jobModel=new Job();
        $data = $model->select();
        $job=$jobModel->select();
        foreach ($job as $v){
            $str=str_replace('&nbsp;','',$v['content']);
            $v['content']=strip_tags($str);
        }
        $url=request()->module().'/'.request()->action();
        $this->assign('data',$data);
        $this->assign('url',$url);
        $this->assign('job',$job);
        return $this->fetch();
    }
    public function news(){
        $model = new Nav();
        $NewsCateModel = new NewsCate();
        $data = $model->select();
        $newscate = $NewsCateModel->select();
        $url=request()->module().'/'.request()->action();
        $this->assign('data',$data);
        $this->assign('url',$url);
        $this->assign('newscate',$newscate);
        return $this->fetch();
    }

}
